package com.jbookshelf.dal.entities;
// Generated 22.12.2012 21:50:33 by Hibernate Tools 4.0.0

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * OrdersHistory generated by hbm2java
 */
@Entity
@Table(name = "ORDERS_HISTORY", schema = "PUBLIC", catalog = "PUBLIC")
public class OrdersHistory implements java.io.Serializable {

	private Integer id;
	private Date timestamp;
	private Orders orders;
	private OrderStatuses orderStatuses;

	public OrdersHistory() {
	}

	public OrdersHistory(Orders orders, OrderStatuses orderStatuses) {
		this.orders = orders;
		this.orderStatuses = orderStatuses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Version
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "timestamp", nullable = false, length = 26)
	public Date getTimestamp() {
		return this.timestamp;
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ORDER_ID")
	public Orders getOrders() {
		return this.orders;
	}

	public void setOrders(Orders orders) {
		this.orders = orders;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STATUS_ID")
	public OrderStatuses getOrderStatuses() {
		return this.orderStatuses;
	}

	public void setOrderStatuses(OrderStatuses orderStatuses) {
		this.orderStatuses = orderStatuses;
	}

}
